let fs =require("fs");
let time1 = new Date().getTime();
for(let i =0;i<1000;i++){
    let filename ="./a1/"+i+".txt";
    fs.writeFileSync(filename,"aaa")

}

let time2 = new Date().getTime();
console.log(time2-time1);

let time3 = new Date().getTime();
for(let i =0;i<1000;i++){
    let filename ="./a2/"+i+".txt";
    fs.writeFile(filename,"aaa",function(err){})

}

let time4 = new Date().getTime();
console.log(time4-time3);